var __extends =
    (this && this.__extends) ||
    (function () {
      var t = function (e, n) {
        return (t =
          Object.setPrototypeOf ||
          ({ __proto__: [] } instanceof Array &&
            function (t, e) {
              t.__proto__ = e;
            }) ||
          function (t, e) {
            for (var n in e)
              Object.prototype.hasOwnProperty.call(e, n) && (t[n] = e[n]);
          })(e, n);
      };
      return function (e, n) {
        function i() {
          this.constructor = e;
        }
        if ("function" != typeof n && null !== n)
          throw new TypeError(
            "Class extends value " + String(n) + " is not a constructor or null"
          );
        t(e, n),
          (e.prototype =
            null === n
              ? Object.create(n)
              : ((i.prototype = n.prototype), new i()));
      };
    })(),
  InviteRechargeView = (function (t) {
    function e() {
      var e = t.call(this) || this;
      return (
        e.btn_back.on(Laya.Event.CLICK, e, e.onClose),
        (e.list_invite.selectEnable = !0),
        (e.list_invite.vScrollBarSkin = ""),
        e.btn_inviteRecharge_chaxun.on(
          Laya.Event.CLICK,
          e,
          e.onSearchInviteRechargeAction
        ),
        e
      );
    }
    return (
      __extends(e, t),
      (e.openView = function () {
        return (
          null == this.instance && (this.instance = new e()),
          (this.instance.list_invite.visible = !1),
          this.instance.myInviteList(),
          this.instance.initShuaixuanData(),
          this.instance
        );
      }),
      (e.prototype.initShuaixuanData = function () {
        var t = new Date(),
          e = t.getFullYear(),
          n = t.getMonth(),
          i = t.getDay();
        this.text_recharge_start.text =
          e.toString() + "-" + n.toString() + "-" + i.toString();
        var o = t.getFullYear(),
          r = t.getMonth() + 1,
          a = t.getDay();
        this.text_recharge_end.text =
          o.toString() + "-" + r.toString() + "-" + a.toString();
      }),
      (e.prototype.onSearchInviteRechargeAction = function () {}),
      (e.prototype.myInviteList = function () {
        var t = new Ajax(this);
        (t.success = this.myInviteListSuccess),
          t.post(Environment.apiHost + "/user-service/user/invite/rechange", {
            page: 1,
            pageSize: 50,
          });
      }),
      (e.prototype.myInviteListSuccess = function (t) {
        if (0 == t.code) {
          var e = t.data;
          (this.label_count.text = t.total + "人"),
            (this.label_sum.text = t.sum / 100 + "元");
          for (var n = [], i = 0; i < e.length; i++) {
            var o = {
              lbl_role_id: { text: e[i].id },
              lbl_area: { text: e[i].area },
              lbl_role_name: { text: e[i].name + "(" + e[i].id + ")" },
              lbl_money: { text: e[i].sum / 100 + "元" },
            };
            n.push(o);
          }
          (this.list_invite.array = n), (this.list_invite.visible = !0);
        } else ToastView.toastView(t.msg);
      }),
      (e.prototype.onClose = function () {
        this.removeSelf();
      }),
      e
    );
  })(ui.InviteController.InviteRechargeViewUI);
